import { storeBindingsBehavior } from "mobx-miniprogram-bindings";
import base from "@src/store/base";

Component({
  options: {
    addGlobalClass: true,
  },
  behaviors: [storeBindingsBehavior],
  storeBindings: [
    {
      store: base,
      fields: ["themeColor"],
    },
  ],
  properties: {
    fullDayRoomState: {
      type: Number,
      value: 0,
    },
    hourRoomState: {
      type: Number,
      value: 0,
    },
    ktvRoomState: {
      type: Number,
      value: 0,
    },
    bookingNotes: {
      type: Object,
      value: null,
    },
  },
  data: {
    activeIndex: 0,
  },
  methods: {
    handleClickTips(e) {
      let index = e.currentTarget.dataset.index;
      console.info("index", index);
      if (this.data.activeIndex === index) {
        this.setData({ activeIndex: null });
      } else {
        this.setData({ activeIndex: index });
      }
    },
  },
});
